<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>list</title>
<#include "/admin/include/head.htm">
<script type="text/javascript">
    var grid;
    $(function () {
        grid = $("#maingrid").ligerGrid({
            columns: [
            	{name:'id',hide:true},
				{display: '退款编号', name: 'refundNo', align: 'center', width: 180},
				{display: '订单编号', name: 'orderItem.order.orderNo', align: 'center', width: 150},
				{display: '申请时间', name: 'createDate', align: 'center', width: 150},
				{display: '是否换货', name: 'isChange', align: 'center', width: 50,dict:'common'},
				{display: '商品名称', name: 'productName', align: 'center', width: 150},
				{display: '批号', name: 'batch', align: 'center', width: 100},
				{display: '退货数量', name: 'quantity', align: 'center', width: 50},
				{display: '退款金额', name: 'subtotal', align: 'center', width: 120},
				{display: '退款状态', name: 'refundStatus', align: 'center', width: 100,i18n:'RefundStatus'},
				{display: '备注', name: 'remark', align: 'center', width: 500}
			], pageSize:20, url: '${base}/admin/b2c/refund/queryData.jhtml',
			toolbar: {}, width: '100%', height:'100%', enabledSort: true
        });
        $("#pageloading").hide();
		LG.loadToolbar(grid);
		
		//绑定搜索按钮
		LG.search(grid);
    });
    
    function detail(){
		var selecteds=grid.getSelecteds();
		if(selecteds.length != 1) {
			LG.tip('请选择一行记录!');
			return;
		}
		$.ligerDialog.open({
			title:"查看退款单",
			height:500,
			width:800,
			url:base+'/admin/b2c/refund/detail/' + selecteds[0].id + '.jhtml'
		});
	}
	
    function change(){
		var selecteds=grid.getSelecteds();
		if(selecteds.length != 1) {
			LG.tip('请选择一行记录!');
			return;
		}
		$.ligerDialog.open({
			title:"换货",
			height:500,
			width:800,
			url:base+'/admin/b2c/refund/change/' + selecteds[0].id + '.jhtml'
		});
	}
	
    function finish(){
		var selecteds=grid.getSelecteds();
		if(selecteds.length != 1) {
			LG.tip('请选择一行记录!');
			return;
		}
		$.ligerDialog.open({
			title:"退款",
			height:500,
			width:800,
			url:base+'/admin/b2c/refund/finish/' + selecteds[0].id + '.jhtml'
		});
	}
	
	function f_delete() {
		var selecteds = grid.getSelecteds();
	    if (selecteds.length > 0) {
	    	jQuery.ligerDialog.confirm('确定删除吗？', function (confirm) {
      			if (confirm){
					LG.ajax({
						url: base + '/admin/b2c/comment/delete.jhtml',
			            loading: '正在删除中...',
			            data: {ids: LG.getIds(selecteds)},
			            success: function () {
							LG.showSuccess('删除成功');
			                f_reload();
			            },
			            error: function (message) {
							LG.showError(message);
			            }
			        });
			    }
			});
		} else {
			LG.tip('请选择行!');
	    }
	}
	
</script>
</head>
<body style="padding:10px; overflow:hidden;">
	<div id="functions">
		<div class="clearfix">
			<div style="float:left;">
				<span>
					退款编号：<input type="text" class="formText" name="search_LIKE_refundNo"/>
				</span>
				<span>
					订单编号：<input type="text" class="formText" name="search_LIKE_orderNo"/>
				</span>
				<span>
					退款状态：<@u.select_map headerKey=" " headerValue="全部" listKey="key" listValue="name" list=refundStatuses
						name="search_EQ_refundStatus"/>
				</span>	
				<span>
					申请时间：<input type="text" id="startDate" name="search_GE_createDate" 
						 class="formText WdatePicker {dateFmt:'yyyy-MM-dd'}" />
						 -
						 <input type="text" id="endDate" name="search_LE_createDate" 
						 class="formText WdatePicker {dateFmt:'yyyy-MM-dd'}" />
				</span>	
				<input type="button" id="search" class="button" value="搜索"/>
				<a href="#" id="search_btn_reset" face="Wingdings 3">解除搜索,显示全部数据</a>
			</div>
		</div>
	</div>
	<div id="maingrid" style="margin:0; padding:0"></div>
</body>
</html>